﻿/*
 * Copyright 2003-2008 非也
 * All rights reserved.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation。
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see http://www.gnu.org/licenses. *
 * @author 非也,nychen2000@163.com
 * @Revision to .NET 无忧 lwz0721@gmail.com 2010-02
 */
using System;
using System.Collections.Generic;
//using System.Linq;
using System.Text;
using FireWorkflow.Net.Kernel.Impl;
using FireWorkflow.Net.Engine;
using FireWorkflow.Net.Engine.Impl;


namespace FireWorkflow.Net.Kernel.Impl
{
	/*
	 * JoinPoint generated by hbm2java
	 */
	[Serializable]
	public class JoinPoint : IJoinPoint
	{
		public JoinPoint() { }

		public JoinPoint(IProcessInstance processInstance)
		{
			this._processInstance = processInstance;
		}

		public String Id { get; set; }

		private IProcessInstance _processInstance;
		public IProcessInstance ProcessInstance
		{
			get { return this._processInstance; }
			set
			{
				this._processInstance = value;
				if (this._processInstance != null)
				{
					this.ProcessInstanceId = value.Id;
				}
				else
				{
					this.ProcessInstanceId = null;
				}
			}
		}

		public String ProcessInstanceId { get; set; }

		public Int32? Value { get; set; }

		public Boolean Alive { get; set; }

		public String SynchronizerId { get; set; }

		public Int32 StepNumber { get; set; }

		public String FromActivityId { get; set; }

		public void addValue(Int32 v)
		{
			if (this.Value == null)
			{
				this.Value = v;
			}
			else
			{
				this.Value = this.Value + v;
			}
		}
	}
}
